﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace Fcdbas.Infrastructure.Querying
{
    /// <summary>
    /// 条件查询
    /// </summary>
    [DataContract]
    [KnownType(typeof(List<Criterion>))]
    public class Query
    {
        private List<Criterion> criteria = new List<Criterion> ();

        public Query()
        {
            if(criteria == null)
                criteria = new List<Criterion>();
        }
        /// <summary>
        /// 条件列表
        /// </summary>
        [DataMember]
        public List<Criterion> Criteria
        {
            get { return this.criteria; }
            set
            {
                this.criteria = value;
            }
        }
       // private List<QueryOperator> queryOperators;
       // public List<QueryOperator> QueryOperator { get; set; }
        [DataMember]
        public OrderByClause OrderByProperty { get; set; }

        public void Add(Criterion criterion)
        {
            criteria.Add(criterion);
           // QueryOperator.Add(opertor);
        }
    }
}
